package com.xinnet.mms.deptarea.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.xinnet.core.dao.impl.BaseDaoImpl;
import com.xinnet.mms.deptarea.dao.DeptAreaDao;
import com.xinnet.mms.entity.Area;
import com.xinnet.mms.entity.DeptArea;
@Repository("deptAreaDao")
public class DeptAreaDaoImpl extends BaseDaoImpl<DeptArea, Long>implements DeptAreaDao{
	
	public List<Area> getAreaList(){
		List<Area> areaList = super.getSqlSession().selectList("Area.getAreaList");
		if(areaList!=null && areaList.size()==0){
			areaList = null;
		}
		return areaList;
	}
	
	public List<Area> getAreaListByDeptId(String deptId){
		List<Area> areaList = super.getSqlSession().selectList("DeptArea.getAreaListByDeptId",deptId);
		if(areaList!=null && areaList.size()==0){
			areaList = null;
		}
		return areaList;
	}
	public List<Area> getAreaListByDeptIdStr(String deptIdStr){
		List<Area> areaList = super.getSqlSession().selectList("DeptArea.getAreaListByDeptIdStr",deptIdStr);
		if(areaList!=null && areaList.size()==0){
			areaList = null;
		}
		return areaList;
	}
	
	public void delDeptAreaByDeptId(String deptId){
		super.getSqlSession().delete("DeptArea.delDeptAreaByDeptId",deptId);
	}
	
	public void addDeptAreaList(List<DeptArea> deptAreaList){
		super.getSqlSession().insert("DeptArea.addDeptAreaList",deptAreaList);
	}
	
	public void addDeptArea(DeptArea deptArea){
		super.getSqlSession().insert("DeptArea.addDeptArea",deptArea);
	}
	
	
	
	

}
